package com.xhwl.centiotdata.pojo.enums.vehicle;

import lombok.Getter;

@Getter
public enum VehicleHandlerEnum {

    VEHICLE_NOTHING(-1, "nothingIntegrationHandler"),
    VEHICLE_FUSHI(64, "fuShiIntegrationHandler"),
    VEHICLE_KETOP(3, "keTopIntegrationHandler"),
    VEHICLE_HAIKANG(2, "haiKangIntegrationHandler");

    VehicleHandlerEnum(Integer productId, String serviceName) {
        this.productId = productId;
        this.serviceName = serviceName;
    }

    private final Integer productId;

    private final String serviceName;

    public static VehicleHandlerEnum toVehicleHandlerEnum(Integer productId) {
        for (VehicleHandlerEnum vehicleHandlerEnum : VehicleHandlerEnum.values()) {
            if (vehicleHandlerEnum.getProductId().equals(productId)) {
                return vehicleHandlerEnum;
            }
        }
        return VEHICLE_NOTHING;
    }

}
